/**
 * 处理用户相关的逻辑
 */
import request from '@/utils/request'

//API常量
const APIS = {
    V1: "/v1"
}

export function queryByPaging(param) {
    return request({
        url: APIS.V1 + `/system/permission/page`,
        method: 'GET',
        params: param
    })
}


export function listTree(param) {
    return request({
        url: APIS.V1 + `/system/permission/listTree`,
        method: 'GET',
        params: param
    })
}

export function trees(param) {
    return request({
        url: APIS.V1 + `/system/permission/trees`,
        method: 'GET',
        params: param
    })
}


export function addOrUpdate(data) {
    return request({
        url: APIS.V1 + `/system/permission/addOrUpdate`,
        method: 'post',
        data
    })
}

export function updateById(id, available) {
    return request({
        url: APIS.V1 + `/system/permission/deleteById?id=` + id + "&available=" + available,
        method: 'get'
    })
}

export function enableOrDisable(permissionsId, available) {
    return request({
        url: APIS.V1 + `/system/permission/enableOrDisable?permissionsId=` + permissionsId + "&available=" + available,
        method: 'get'
    })
}
